package cn.xiaou.view;

import java.awt.Color;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;

import javax.swing.JTextField;

import cn.xiaou.draw.MyTextFieldBorder;

public class ShineJText implements FocusListener{
	private Color Shinecolor;
	private Color color = Color.BLACK;
	
	public ShineJText(Color shinecolor, Color color) {
		super();
		Shinecolor = shinecolor;
		this.color = color;
	}
	public ShineJText(Color shinecolor) {
		super();
		Shinecolor = shinecolor;
	}

	@Override
	public void focusGained(FocusEvent e) {
		JTextField text = (JTextField)e.getSource();
		text.setBorder(new MyTextFieldBorder(Shinecolor));
		
	}

	@Override
	public void focusLost(FocusEvent e) {
		JTextField text = (JTextField)e.getSource();
		text.setBorder(new MyTextFieldBorder(color));
	}

}
